﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yitter;
using Yitter.IdGenerator;

namespace RBAC_Model
{
    public class User : BaseEntity
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Required]
        [StringLength(50)]
        public string UserName { get; set; }
        /// <summary>
        /// 真实姓名
        /// </summary>
        public string RealName { get; set; }
        
        /// <summary>
        /// 密码
        /// </summary>
        [Required]
        [StringLength(100)]
        public string Password { get; set; }
        
        /// <summary>
        /// 邮箱
        /// </summary>
        [EmailAddress]
        [StringLength(100)]
        public string Email { get; set; }
        /// <summary>
        /// 手机
        /// </summary>
        public string Phone { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        public string Address { get; set; }
        
        /// <summary>
        /// 是否激活
        /// </summary>
        public bool IsActive { get; set; } = true;
        
        /// <summary>
        /// 用户构造函数
        /// </summary>
        //public User()
        //{
        //    Id = YitIdHelper.NextId();
        //    CreateTime = DateTime.Now;
        //    UpdateTime = DateTime.Now;
        //}
    }
}
